Skip to content

Conversation

@patrickthornton
Copy link
Contributor

allows check50 to catch wrong .randrange/.randint before it becomes pedagogically disastrous

allows check50 to catch wrong .randrange/.randint before it becomes
disastrous
@rongxin-liu
Copy link
Contributor

Fixes #238

@rongxin-liu rongxin-liu self-assigned this Jan 24, 2025
@rongxin-liu rongxin-liu added CS50P CS50 Python enhancement New feature or request labels Jan 24, 2025
@check50.check(test_valid_level)
def test_random():
"""Little Professor generates random numbers correctly"""
level = "1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible that some students might use random.randrange for levels 2 and 3 but not for level 1, and check50 would not be able to detect it. However, the likelihood of such a scenario is so low that it may not be worth the effort to check all levels.

@rongxin-liu rongxin-liu merged commit 238ac4d into cs50:2022/python Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CS50P CS50 Python enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants